package com.itheima.day09;

import java.util.Arrays;

public class Test01 {

    public static void main(String[] args) {
        //
        String s="魑魅魍魉吴签签";
        //strs.compareTo()
        System.out.println(s.compareTo("妖魔鬼怪吴亦凡"));
        //strs.length()
        System.out.println(s.length());
        //strs.equals()
        System.out.println(s.equals("魑魅魍魉吴签签"));
        System.out.println(s.equals("魑魅魍魉吴签签1"));
        //strs.endsWith(".avi")
        System.out.println(s.endsWith("签签"));
        System.out.println(s.endsWith("亦凡"));
        //strs.startsWith()
        System.out.println(s.startsWith("魑魅魍魉"));
        System.out.println(s.startsWith("妖魔鬼怪"));
        //strs.split()
        String[] strs = s.split("吴");
        System.out.println(Arrays.toString(strs));
        //strs.contains()
        System.out.println(s.contains("签签"));
        System.out.println(s.contains("坤坤"));
        //strs.charAt()
        for (int i = 0; i < s.length(); i++) {
            System.out.println(s.charAt(i));
        }
        //strs.concat()
        String ss= s.concat("妖魔鬼怪吴亦凡");
        System.out.println(ss);
        //strs.indexOf("fab")
        System.out.println(ss.indexOf("吴亦凡"));
        //strs.replace()
        String replace = ss.replace("吴亦凡", "吴签签");
        System.out.println(replace);
        //strs.lastIndexOf("xxx")
        System.out.println(replace.lastIndexOf("吴签签"));
        //strs.replaceAll()
        String s1 = replace.replaceAll("签签", "坤坤");
        System.out.println(s1);
        //strs.toLowerCase()
        System.out.println("ABC".toLowerCase());
        //strs.toUpperCase()
        String s2 = "abc".toUpperCase();
        System.out.println(s2);
        //strs.trim()
        System.out.println("           吴 亦 凡           ".trim());


    }
}
